package com.xianggu.common;

import com.xianggu.annotation.FeignClient;
import com.xianggu.demo.dto.UserDto;
import com.xianggu.fallback.XiangGuFallbackFactory;
import com.xianggu.mybatis.paging.Page;

import java.net.URL;
import java.util.List;
import java.util.Map;

/**
 * @author chengjy
 * @date 2025/3/8
 */
@FeignClient(serviceName = "Provider" , fallbackFactory = XiangGuFallbackFactory.class)
public interface XiangGuService {
    String doService(String text);

    UserDto getUserInfo(String id);
    List<UserDto> queryUserList(String condition);

    public static void main(String[] args) {
        URL resource = XiangGuService.class.getClassLoader().getResource("com/xianggu");
        System.out.println(resource.getFile());
    }


    String saveUser(UserDto userDto);

    Page<UserDto> getUserList(String id, int pageNum, int pageSize);

    List<Map<String, Object>> getUserListMap(String id, int pageNum, int pageSize);

    Page<UserDto> getInitList(int pageNum, int pageSize);

    UserDto getUserById(String id);

    String updateById(UserDto userDto);

    String deleteById(String id);

    Page<UserDto> searchContidion(Map<String, Object> param);
}
